package com.quyl.poi.util;

import lombok.Data;

/**
 * 解析系统盘符
 */
@Data
public class CommonUtils {

    private static String FILE_UPLOAD_PATH_WIN = "D:\\";
    private static String FILE_UPLOAD_PATH_MAC = "/usr/home/";
    private static String FILE_UPLOAD_PATH_LINUX = "/usr/home/";

    /**
     * 获取当前操作系统
     *
     * @return
     */
    public static String getOperateSystem() {
        String os = System.getProperty("os.name");
        if (os != null) {
            os = os.toLowerCase();
        }
        //windows
        assert os != null;
        if (os.contains("windows")) {
            return FILE_UPLOAD_PATH_WIN;
        }
        if (os.contains("mac")) {
            return FILE_UPLOAD_PATH_MAC;
        }
        if (os.contains("linux")) {
            return FILE_UPLOAD_PATH_LINUX;
        }
        return "当前操作系统目前暂不支持!";
    }
}
